// 引入ajax
import services from '../../services/services.js'

class Attendance {
    // 课程列表
    myAllActivities(data, isLoading = true) {
        return services.ajax({
            url: '/v1/auth/myAllActivities',
            data: data,
            method: 'POST',
            isLoading
        })
    }
    // 详情
    attendanceDetail(data, isLoading = false) {
        return services.ajax({
            url: '/v1/attendance/detail',
            data: data,
            method: 'POST',
            isLoading
        })
    }
  // 创建打卡
  momentCreate(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/create',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  // 修改打卡
  momentModify(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/modify',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //左右滑动
  momentMyNotThumbList(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/myNotThumbList',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //我的全部练习
  momentMyAllList(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/myAllList',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //打卡删除
  momentDelete(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/delete',
      data: data,
      method: 'POST',
      isLoading
    })
  }
  //打卡列表
  momentList(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/list',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //评论列表
  commentList(data, isLoading = false) {
    return services.ajax({
      url: '/v1/comment/list',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //删除评论
  commentDelete(data, isLoading = false) {
    return services.ajax({
      url: '/v1/comment/delete',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //评论他人
  commentAdd(data, isLoading = false) {
    return services.ajax({
      url: '/v1/comment/add',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  // 获取当日任务
  dailyTaskDetail(data, isLoading = false) {
    return services.ajax({
      url: '/v1/attendance/getDailyTaskDetail',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  // 点赞
  thumbSave(data, isLoading = false) {
    return services.ajax({
      url: '/v1/thumb/save',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //获取某一个打卡
  momentDetail(data, isLoading = false) {
    return services.ajax({
      url: '/v1/moment/detail',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //训练营详细
  attendanceDetail(data, isLoading = false) {
    return services.ajax({
      url: '/v1/attendance/detail',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //点赞列表
  thumbList(data, isLoading = false) {
    return services.ajax({
      url: '/v1/thumb/list',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //评论内容
  commentDetail(data, isLoading = false) {
    return services.ajax({
      url: '/v1/comment/detail',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //是否有进行中的活动
  hasActiveAttendance(data, isLoading = false) {
    return services.ajax({
      url: '/v1/auth/hasActiveAttendance',
      data: data,
      method: 'POST',
      isLoading
    })
  }
  //
    isCommented(data, isLoading = false) {
    return services.ajax({
      url: '/v1/comment/isCommented',
      data: data,
      method: 'POST',
      isLoading
    })
  }
}


module.exports = new Attendance()